Intelligent automated assistants (or virtual assistants) provide an intuitive interface between users and electronic devices. These assistants can allow users to interact with devices or systems using natural language in spoken and/or text forms. For example, a user can access the services of an electronic device by providing a spoken user input in natural language form to a virtual assistant associated with the electronic device. The virtual assistant can perform natural language processing on the spoken user input to infer the user's intent and operationalize the user's intent into tasks. The tasks can then be performed by executing one or more functions of the electronic device, and a relevant output can be returned to the user in natural language form.
To generate the output in natural language form, conventional virtual assistants require that a developer specify the content and format of every possible natural language output (e.g., in full-sentence form), as well as the specific conditions that must be met for each output to be returned to the user. For example, a virtual assistant can be programmed to output the string “Your search returned <results.number> results” in response to a search query yielding multiple results, can be programmed to output the string “Your search returned one result” in response to a search query yielding one result, and can be programmed to output the string “Your search returned no results” in response to a search query yielding no results.
While conventional virtual assistants programmed in this way can produce relevant outputs in natural language form, the process of specifying the content and format of every possible natural language output can be time-consuming and can produce repetitive results.